import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/fundAlert',
      name: 'fundAlert',
      component: () => import('@/views/fundAlert/fundAlert.vue'),
    },
    {
      path: '/etfPegging',
      name: 'etfPegging',
      component: () => import('@/views/etfPegging/index.vue'),
    },
    // 大类资产收益表现
    {
      path: '/assetReturn',
      name: 'assetReturn',
      component: () => import('@/views/trendAssessment/assetReturn/index.vue'),
    },
    // 固定收益市场研判
    {
      path: '/fixedAssessment',
      name: 'fixedAssessment',
      component: () => import('@/views/trendAssessment/fixedAssessment/index.vue'),
    },
    // 权益市场研判
    {
      path: '/equityAssessment',
      name: 'equityAssessment',
      component: () => import('@/views/trendAssessment/equityAssessment/index.vue'),
    },
  ],
})

//监听主应用的路由变化，从而动态切换路由
// @ts-expect-error ignore wujie type check
window.$wujie?.bus.$on('childRouterChange', (path) => router.push({ path }))

export default router
